package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 用户类型枚举
 */
@Getter
@AllArgsConstructor
public enum UserTypeEnum {
	SYSTEM_USER(10, "平台用户"),
	TENANT_USER(11, "租户用户"),
	SUPPLY_USER(12, "供应商用户"),
	CUSTOMER_USER(13, "客户");
	/**
	 * 类型
	 */
	private Integer code;

	/**
	 * 描述
	 */
	private String description;

	public static UserTypeEnum get(Integer code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (UserTypeEnum userTypeEnum : UserTypeEnum.values()){
			if (code.equals(userTypeEnum.code))  return userTypeEnum;
		}
		return null;
	}
}
